﻿<%@ Page Title="" Language="C#" MasterPageFile="~/ANMCMaster.Master" AutoEventWireup="true" CodeBehind="Fileshare.aspx.cs" Inherits="AllNations.UI.Fileshare" %>
<%@ Register src="~/Controls/StaticMainImage.ascx" TagName="StaticMainImage" TagPrefix="ANMC" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ANHeaderContent" runat="server">
    <script type="text/javascript">
        function ShareNewFile() {
            var frm = document.getElementById('<%= panelAddNewFile.ClientID %>');
            if (frm.style["display"] == "none") {
                frm.style["display"] = "block";
                var txtFileTitle = document.getElementById('<%= txtFileTitle.ClientID %>');
                txtFileTitle.focus();
            } else
                frm.style["display"] = "none";
        }
    </script>
</asp:Content>
<asp:Content ID="ANPageHeader1" ContentPlaceHolderID="ANPageHeader" runat="server">
    <asp:Image ID="HeaderImage1" runat="server" ImageUrl="~/Images/worship_main.png" Visible="true" />
    <ANMC:StaticMainImage ID="StaticMainImage1" runat="server" MainImageUrl="~/Images/home_main_missional_church2.png" Visible="false" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ANBodyContent" runat="server">
    <div class="leftnav">
        <telerik:RadMultiPage ID="LeftNavigationChoice" runat="server" RenderSelectedPageOnly="true">
            <telerik:RadPageView ID="viewMain" runat="server">
                <div style="margin: 11px 0px 25px 0px;"><asp:Image ID="Image6" runat="server" ImageUrl="~/Images/sectionTitleFellowship.png" /></div>
                <telerik:RadMenu ID="radMenuLeftNav" runat="server" EnableEmbeddedSkins="false" 
                    Skin="ANMCLeftNav">
                    <Items>
                        <telerik:RadMenuItem Text="교회소식" Value="Announcements" NavigateUrl="~/Announcements/Main"></telerik:RadMenuItem>
                        <telerik:RadMenuItem Text="주보" Value="SundayBulletin" Selected="true"></telerik:RadMenuItem>
                        <telerik:RadMenuItem Text="앨범" Value="PhotoAlbum" NavigateUrl="~/PhotoAlbum/Main"></telerik:RadMenuItem>
                        <telerik:RadMenuItem Text="행사계획" Value="UpcomingEvents" NavigateUrl="~/Fellowship?UpcomingEvents"></telerik:RadMenuItem>
                        <telerik:RadMenuItem Text="목장사역" Value="SmallGroups" NavigateUrl="~/Fellowship?SmallGroups"></telerik:RadMenuItem>
                    </Items>
                </telerik:RadMenu>
            </telerik:RadPageView>
            <telerik:RadPageView ID="viewSeekingTruth" runat="server">
                <div style="margin: 11px 0px 25px 0px;"><asp:Image ID="Image1" runat="server" ImageUrl="~/Images/sectionTitleEducation.png" /></div>
                <telerik:RadMenu ID="radEducationMenuLeftNav" runat="server" EnableEmbeddedSkins="false" 
                    Skin="ANMCLeftNav">
                    <Items>
                        <telerik:RadMenuItem Text="어린이부" Value="SundaySchool" NavigateUrl="~/Education"></telerik:RadMenuItem>
                        <telerik:RadMenuItem Text="중고등부" Value="YouthGroup" NavigateUrl="~/Education?YouthGroup"></telerik:RadMenuItem>
                        <telerik:RadMenuItem Text="AWANA" Value="AWANA" NavigateUrl="~/Education?AWANA"></telerik:RadMenuItem>
                        <telerik:RadMenuItem Text="청년부" Value="YoungAdults" NavigateUrl="~/Education?YoungAdults"></telerik:RadMenuItem>
                        <telerik:RadMenuItem Text="장년 6 단계 양육" Value="Adults" NavigateUrl="~/Education?Adults"></telerik:RadMenuItem>
                        <telerik:RadMenuItem Text="진리를 찾아서" Value="SeekTruth" Selected="true"></telerik:RadMenuItem>
                        <telerik:RadMenuItem Text="어린이부 자료실" Value="SundaySchoolResources" NavigateUrl="~/SundaySchoolResource.aspx"></telerik:RadMenuItem>
                    </Items>
                </telerik:RadMenu>
            </telerik:RadPageView>
            <telerik:RadPageView ID="viewMissionMenu" runat="server">
                <div style="margin: 11px 0px 25px 0px;"><asp:Image ID="Image2" runat="server" ImageUrl="~/Images/sectionTitleMission.png" /></div>
                <telerik:RadMenu ID="radMissionMenuLeftNav" runat="server" EnableEmbeddedSkins="false" 
                    Skin="ANMCLeftNav">
                    <Items>
                        <telerik:RadMenuItem Text="파송/협력 선교사" Value="Missionaries" NavigateUrl="~/Mission"></telerik:RadMenuItem>
                        <telerik:RadMenuItem Text="선교지 소식" Value="MissionNews" Selected="true"></telerik:RadMenuItem>
                    </Items>
                </telerik:RadMenu>
            </telerik:RadPageView>
        </telerik:RadMultiPage>
    </div>
    <div class="rightcontentarea">
        <div id="contentBoxHolder">
            <div class="ContentTitleBar">
                <asp:Image ID="imgContentTitleBar" runat="server" ImageUrl="~/Images/titleSundayBulletin.png" />
            </div>
            <article class="node static-page content">
                <asp:Panel ID="panelAddNewFile" runat="server" style="display:none">
                    <table cellpadding="0" cellspacing="0" border="0">
                        <tr>
                            <td style="padding: 4px">Select new file:</td>
                            <td style="padding: 4px"><telerik:RadUpload ID="fuNewFile" runat="server" MaxFileInputsCount="1" ControlObjectsVisibility="None" /></td>
                        </tr>
                        <tr>
                            <td style="padding: 4px">File title:</td>
                            <td style="padding: 4px"><asp:TextBox ID="txtFileTitle" runat="server" Width="400px" /></td>
                        </tr>
                        <tr>
                            <td style="padding: 4px">&nbsp;</td>
                            <td style="padding: 4px">
                                <asp:Button ID="btSaveNewFile" runat="server" Text="Upload" OnClick="btSaveNewFile_Click" />
                                <asp:Button ID="btCancelUpload" runat="server" Text="Cancel" OnClientClick="ShareNewFile(); return false;" /><br />
                                <asp:Label ID="lblErrorMesg" runat="server" ForeColor="Red" />
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
                <asp:Repeater ID="rptFileShare" runat="server">
                    <HeaderTemplate>
                        <table cellpadding="0" cellspacing="0" border="0" class="anmcList">
                        <tr class="header">
                            <td><strong>제목</strong></td>
                            <td style="text-align: center"><strong>파일</strong></td>
                            <td><strong>날짜</strong></td>
                            <td runat="server" visible='<%# IsPageAdministrator() %>'><strong>관리</strong></td>
                        </tr>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr>
                            <td><asp:HyperLink runat="server" ID="lnkDownloadTitle" NavigateUrl='<%# string.Format("~/FileShareDownload.ashx?FileshareId={0}", Eval("fileshare_id")) %>'><%# Eval("subject_txt") %></asp:HyperLink></td>
                            <td style="text-align: center"><asp:HyperLink runat="server" ID="lnkDownload" NavigateUrl='<%# string.Format("~/FileShareDownload.ashx?FileshareId={0}", Eval("fileshare_id")) %>'><asp:Image runat="server" ImageUrl="~/Images/export-button-16x16.png" /></asp:HyperLink></td>
                            <td><%# Eval("create_dttm", "{0:d}")%></td>
                            <td style="white-space: nowrap;" runat="server" visible='<%# IsPageAdministrator() %>'>
                                <asp:LinkButton ID="lnkDelete" runat="server" OnClick="lnkDelete_Click" Font-Underline="false" OnClientClick="if (!confirm('You are about to delete a file, click OK to continue.')) return false;" CommandArgument='<%# Eval("fileshare_id") %>'><asp:Image runat="server" ImageUrl="~/Images/delete.gif" ImageAlign="AbsMiddle" style="float: left" />&nbsp;Delete</asp:LinkButton>
                            </td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        </table>
                    </FooterTemplate>
                </asp:Repeater>
            </article>
        </div>
        <div style="clear: both;"></div>
    </div>
    <div style="clear: both;"></div>
</asp:Content>
